<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('shopCartAdminProducts/' . ($form->getObject()->isNew() ? 'create' : 'update') . (!$form->getObject()->isNew() ? '?id=' . $form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?> name="product">
    <?php if (!$form->getObject()->isNew()): ?>
        <input type="hidden" name="sf_method" value="put" />
    <?php endif; ?>
    <ul class="contactform editProduct">
        <?php echo $form->renderGlobalErrors() ?>
        <li>
            <label for="title"><?php echo $form['title']->renderLabelName() ?><span class="required">*</span></label>
            <span class="fieldbox"><?php echo $form['title']->render() ?></span>
        </li>
        <?php if ($form['title']->hasError()): ?>
            <li>
                <p><?php echo $form['title']->getError() ?></p>
            </li>
        <?php endif; ?>
        <li>
            <label for="price"><?php echo $form['price']->renderLabelName() ?><span class="required">*</span></label>
            <span class="fieldbox">$<?php echo $form['price']->render() ?></span>
        </li>
        <?php if ($form['price']->hasError()): ?>
            <li>
                <p> <?php echo $form['price']->getError() ?></p>
            </li>
        <?php endif; ?>


        <li>
            <label for="sample_path"><?php echo $form['sample_path']->renderLabelName() ?></label>
            <span class="fieldbox"><?php echo $form['sample_path']->render() ?>  available types <?php echo preg_replace('/audio\//i', '', implode(' , ', array_unique(array_map('strtolower', sfConfig::get('app_sample_mime_types'))))) ?></span>
        </li>
        <?php if ($form['sample_path']->hasError()): ?>
            <li>
                <p><?php echo $form['sample_path']->getError() ?></p>
            </li>
        <?php endif; ?>
        <li>
            <label for="sample_time"><?php echo $form['sample_time']->renderLabelName() ?></label>
            <span class="fieldbox"><?php echo $form['sample_time']->render() ?></span>
        </li>
        <?php if ($form['sample_time']->hasError()): ?>
            <li>
                <p><?php echo $form['sample_time']->getError() ?></p>
            </li>
        <?php endif; ?>
        <li>
            <label for="image"><?php echo $form['image']->renderLabelName() ?><span class="required">*</span></label>
            <span class="fieldbox"><?php echo $form['image']->render() ?>   available types <?php echo preg_replace('/image\//i', '', implode(' , ', array_unique(array_map('strtolower', sfConfig::get('app_image_mime_types'))))) ?></span>
        </li>
        <?php if ($form['image']->hasError()): ?>
            <li>
                <p><?php echo $form['image']->getError() ?></p>
            </li>
        <?php endif; ?>


        <li>
            <label class="textbox" for="description"><?php echo $form['description']->renderLabelName() ?></label>
            <span class="msgbox"><?php echo $form['description']->render(array('class' => "area", 'rows'  => "8", 'cols'  => "30")) ?></span>
        </li>
        <?php if ($form['description']->hasError()): ?>
            <li>
                <p><?php echo $form['description']->getError() ?></p>
            </li>
        <?php endif; ?>
        <li>
            <p>required field*</p>
        </li>
        <li>
            <input type="submit" value="save" name="sendbutton" class="button send">
        </li>
        <?php echo $form->renderHiddenFields(false) ?>
    </ul>
</form>
